import request from '@/utils/request'

export default {
  // 列表
  query(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand/list`,
      method: 'post',
      data
    })
  },
  // 添加
  create(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand/create`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // 编辑
  edit(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand/edit`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // 详情
  detail(params) {
    return request({
      url: `/v1/purchase-demand/purchase-demand/detail`,
      method: 'get',
      params
    })
  },
  // 提交
  submit(params) {
    return request({
      url: `/v1/purchase-demand/purchase-demand/submit`,
      method: 'get',
      params
    })
  },
  // 批量提交
  batchSubmit(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand/batch-submit`,
      method: 'post',
      data
    })
  },
  // 批量审核
  batchAudit(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand/batch-audit`,
      method: 'post',
      data
    })
  },
  // 取消
  remove(params) {
    return request({
      url: `/v1/purchase-demand/purchase-demand/remove`,
      method: 'get',
      params
    })
  },
  // 作废
  cancel(params) {
    return request({
      url: `/v1/purchase-demand/purchase-demand/cancel`,
      method: 'get',
      params
    })
  },
  // 反审
  back(params) {
    return request({
      url: `/v1/purchase-demand/purchase-demand/back`,
      method: 'get',
      params
    })
  },
  // 完结审核
  complete(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand/complete`,
      method: 'post',
      data
    })
  },
  // 变更
  skuChange(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/change`,
      method: 'post',
      data
    })
  },
  // 批量添加sku
  batchAddSku(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand/batch-add-sku`,
      method: 'post',
      data
    })
  },
  // 统计
  total(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand/total`,
      method: 'post',
      data
    })
  },
  // 手工完结
  skuComplete(params) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/complete`,
      method: 'get',
      params
    })
  },
  // 获取是否存在变更数据
  getChange(params) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/get-change`,
      method: 'get',
      params
    })
  },
  // 获取 关联的备料计划
  getPlan(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand/get-plan`,
      method: 'post',
      data
    })
  },
}
